<!doctype html>
<html lang="">
	<head>
		<meta charset="UTF-8" />
		<link rel="icon" href="/favicon.ico" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title><%- title %></title>
		<%- script %>
	</head>
	<body>
		<div id="app"></div>
		<script type="module" src="/src/main.ts"></script>
		<script>
			// 监控 JS 加载性能
			function monitorJSLoading() {
				const observer = new PerformanceObserver(list => {
					list.getEntries().forEach(entry => {
						if (entry.name.includes('.js')) {
							const loadTime = entry.duration
							console.log(`📊 JS Load: ${entry.name} - ${loadTime.toFixed(2)}ms`)

							// 性能评级
							if (loadTime < 10) {
								console.log('🟢 Excellent performance')
							} else if (loadTime < 50) {
								console.log('🟡 Good performance') // ← 你的情况
							} else if (loadTime < 100) {
								console.log('🟠 Average performance')
							} else {
								console.log('🔴 Poor performance - needs optimization')
							}
						}
					})
				})

				observer.observe({ entryTypes: ['resource'] })
			}

			monitorJSLoading()
		</script>
	</body>
</html>
